<%@ page language="java" pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html>
<head>
    <base href="${base}/"/>
    <title>添加管理员</title>
    <meta charset="utf-8"/>
    <link rel="stylesheet" href="css/admin.css"/>
    <style>
        .form_table {
            width: 400px;
            margin: 20px auto;
            border-collapse: collapse;
        }

        .form_table th, .form_table td {
            padding: 10px;
            border: 1px solid #ddd;
            text-align: left;
        }

        .form_table th {
            width: 100px;
            font-weight: bold;
            background-color: #f2f2f2;
        }

        .form_table input[type="text"],
        .form_table input[type="password"] {
            width: 100%;
            padding: 8px;
            margin-bottom: 5px;
            border: 1px solid #ccc;
            border-radius: 4px;
            box-sizing: border-box;
        }

        .form_table button[type="submit"] {
            background-color: #007bff;
            color: white;
            padding: 10px 15px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-size: 16px;
        }

        .form_table button[type="submit"]:hover {
            background-color: #0056b3;
        }

        .error-message {
            color: red;
            margin-top: 5px;
        }
    </style>
</head>
<body>
<div class="container">
    <div id="header">
        <div class="logo">
            <a href=""><img src="images/admin/logo.png" width="303" height="43"/></a>
        </div>
        <p>
            <a href="/admin/logout">退出管理</a> <a href="/admin">后台首页</a> <a href="/" target='_blank'>商城首页</a>
            <span>您好 <label class='bold'>${sessionScope.LoginUser.account}</label></span>
        </p>
    </div>

    <div id="admin_left">
        <ul class="submenu">
            <ul class="menu">
                <li><a href="/admin/goods/list">商品列表</a></li>
                <li><a href="admin/goods/add">增加商品</a></li>
                <li><a href="admin/user/list">用户列表</a></li>
                <li><a href="admin/manager/list">管理员列表</a></li>
                <li><a href="/admin/manager/add">添加管理员</a></li>
            </ul>
        </ul>
        <div id="copyright"></div>
    </div>

    <div id="admin_right">
        <div class="content_box">
            <div class="content">
                <div class="title">
                    <h2>添加管理员</h2>
                </div>
                <form action="/admin/manager/save" method="post" class="form_table">
                    <table>
                        <tr>
                            <th>账号:</th>
                            <td><input type="text" name="account" required minlength="2" maxlength="10">
                                <div class="error-message" id="accountError"></div>
                            </td>
                        </tr>
                        <tr>
                            <th>密码:</th>
                            <td><input type="password" name="password" required>
                                <div class="error-message" id="passwordError"></div>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" style="text-align: center;">
                                <button type="submit">添加</button>
                            </td>
                        </tr>
                    </table>
                </form>
            </div>
        </div>
    </div>
    <div id="separator"></div>
</div>
</body>
</html>